/*
 * @Author: lhl 1079161148@qq.com
 * @Date: 2024-04-04 09:55:24
 * @LastEditors: lhl 1079161148@qq.com
 * @LastEditTime: 2024-04-04 22:45:49
 * @FilePath: \net-cloud-music\src\stores\counter.ts
 * @Description: pinia 配置
 */
import { ref, computed } from 'vue'
import { defineStore } from 'pinia'

export const useCounterStore = defineStore(
  'counter',
  () => {
    const count = ref(0)
    const doubleCount = computed(() => count.value * 2)
    function increment() {
      count.value++
    }

    return { count, doubleCount, increment }
  },
  {
    // 现在，你的整个 Store 将使用默认持久化配置保存 在这里进行自定义配置
    persist: true
  }
)
